/*	编写函数统计一个给定整数中各个数位上某个给定数字出现的次数
 *
 */

#include<stdio.h>

int check(int num, int num1) {
	int  times = 0;
	for (; num > 0; ) {
		if (num % 10 == num1) {
			times++;
		}
		num = num / 10;
	}
	return times;
}

int main () {
	int num = 0, num1 = 0;
	printf("输入检测数字:");
	scanf("%d", &num);
	printf("输入计数数字:");
	scanf("%d", &num1);
	printf("%d包含%d个%d.\n", num, check(num, num1), num1);
	return 0;
}
